import request from '@/utils/request'
/* 
获取组织架构数据
*/
export function getDepartments(data) {
  return request({
    url: '/company/department',
    method:"GET", // 可省略 默认get
    data
  })
}

/* 
根据id 删除部门
*/

export function delDepartments(id){
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}

/* 
新增部门
*/

export function addDepartments(data){
  return request({
    url: `/company/department`,
    method: 'post',
    data
  })
}

/* 
部门负责人
*/
export function getEmployeeSimple () {
  return request({
    url: `/sys/user/simple`,
 })
}


/* 
获取部门详细信息
*/
export function getDepartDetail (id) {
  return request({
    url: `/company/department/${id}`,
 })
}

/* 
编辑 
*/
export function updateDepartments (data) {
  // 返回一个axios对象
  return request({
    url: `/company/department/${data.id}`,
    method: "put",
    data
 })
}

